package com.blb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.entity.Company;
import com.blb.entity.Par;
import com.blb.entity.Product;
import com.blb.entity.Relation;
import com.blb.mapper.CustomerMapper;
import com.blb.service.ICustomerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Relation> implements ICustomerService {
    @Resource
    private CustomerMapper customerMapper;


    @Override
    public List<Relation> CustomerCompany(int start, int length, String companyId, String companyProvince, String companyCity, String companyArea, String companyName) {
        return customerMapper.CustomerCompany(start,length,companyId,companyProvince,companyCity,companyArea,companyName);
    }

    @Override
    public int count(String companyId,String companyProvince, String companyCity, String companyArea, String companyName) {
        return customerMapper.count(companyId,companyProvince,companyCity,companyArea,companyName);
    }

    @Override
    public Relation findByCompanyId(String companyId) {
        return customerMapper.findByCompanyId(companyId);
    }

    @Override
    public List<Company> allCompany(int start, int length, String companyId, String companyName, String companyBrand) {
        return customerMapper.allCompany(start,length,companyId,companyName,companyBrand);
    }

    @Override
    public int count2(String companyId,String companyName, String companyBrand) {
        return customerMapper.count2(companyId,companyName,companyBrand);
    }


    @Override
    public void updateCompany(String rRemark, String companyId) {
        customerMapper.updateCompany(rRemark,companyId);
    }

    @Override
    public void addCustomer(Company company) {
        customerMapper.addCustomer(company);
    }
    @Override
    public void addRelation(Relation relation) {
        customerMapper.addRelation(relation);
    }

    @Override
    public void addPar(Par par) {
        customerMapper.addPar(par);
    }

    @Override
    public List<Map<String, Object>> findAllOrderList( String customerId, String supplierId) {
        return customerMapper.findAllOrderList(customerId,supplierId);
    }

    @Override
    public List<Product> getCustomerCompanyProductInfo(List<String> ids, String companyId, int start, int length) {
        return customerMapper.getCustomerCompanyProductInfo(ids,companyId,start,length);
    }

    @Override
    public int count3(List<String> ids, String companyId) {
        return customerMapper.count3(ids,companyId);
    }




}
